/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package sda.levelup.ciphers;

/**
 *
 * @author Дима
 */
public class Scrambler
{

    public enum CipherType
    {

        CAESAR, VIGENERE
    }

    public String encryptText(String text, String key, CipherType cipher)
    {
        String res = "";
        switch (cipher)
        {
            case CAESAR:
                Caesar caesar = new Caesar();
                res = caesar.encrypt(text, key);

            case VIGENERE:
                Vigenere vigenere = new Vigenere();
                res = vigenere.encrypt(text, key);
        }
        return res;

    }

    public String decryptText(String text, String key, CipherType cipher)
    {
        String res = "";
        switch (cipher)
        {
            case CAESAR:
                Caesar caesar = new Caesar();
                res = caesar.decrypt(text, key);

            case VIGENERE:
                Vigenere vigenere = new Vigenere();
                res = vigenere.decrypt(text, key);
        }
        return res;

    }

}
